home *** CD-ROM | disk | FTP | other *** search
- Path: port-1-5.access.one.net!oren
- From: Oren Levin <oren@one.net>
- Newsgroups: comp.lang.c
- Subject: HELP: Illegal Pointer Arithmetic
- Date: 23 Feb 1996 00:15:12 GMT
- Organization: OneNet Communications HUB News Server
- Distribution: world
- Message-ID: <4gj0ug$730@news.one.net>
- NNTP-Posting-Host: port-1-5.access.one.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- X-Newsreader: Nuntius 2.0.4_68K
- X-XXMessage-ID: <AD527149A301C10F@port-1-5.access.one.net>
- X-XXDate: Thu, 22 Feb 1996 00:15:21 GMT
-
- I was wondering if someone could help me. I'm in the midst of learning
- C/C++ and am trying to program the examples in Andrew Birnstock and John
- Rex's book "Practical Algorithyms for Programers." I am using Symentec's
- Think C++ (v 6 - Mac).
- The following code is giving me a "illegal pointer arithmetic" error.
- I'm trying to strip the carrage return off of a line of text read from a
- file.
-
- TIA for the help.
- Oren Levin
- oren@one.net
-
- === code snippet ===
- while (! feof (fin))
- {
- /* read a record */
- if (fgets (buffer, 127, fin) == NULL)
- break;
-
- /* get rid of the trailing carrage return */
- buffer [strlen (buffer) - 1] = "\0";
-